package com.rzjm.api.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;
import java.util.List;


/**
 * 传感设备表
 *
 * @author mr.zhou
 * @email zhouwei_nice@163.com
 * @date 2020-12-15 22:36:23
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
@TableName("ck_device")
public class Device implements Serializable {
	private static final long serialVersionUID = 1L;

	//主键
	@TableId(type = IdType.AUTO)
	private Integer id;
	private String deviceNum;
	private Integer shopId;
	private String deviceName;
	private Integer onlineState;

	/**
	 *  测温设备位置类型 1-制粒机 2-锅炉 3-油罐
	 */
	private Integer positionType;

	/**
	 *  设备类型  2 - 测温度 3 - 测电流  4 - 测重量   5 - 筒仓 测量   6 - 边缘盒子  7 - 烟感
	 *  设备类型  0 - 温度传感器  1 - 电焊机 2 - 超高温传感器  3 - 称重（电流） 4 -  油罐测量  5 - 筒仓 测量   6 - 边缘盒子  7 - 烟感
	 */
	private Integer deviceType;
	private Float warnMaxValue;
	private Float warnMinValue;
	private Float currentValue;
	private Integer isStartMaxWarning;
	private Integer isStartMinWarning;
	private Integer leaderAdminId;
	private Integer	leaderWxUserId;
	private String leaderName;
	private String leaderPhone;
	private String address;
	private Integer isWarning;

	private Integer warningTimeInterval;

	private Double xishuA;

	private Double xishuB;

	private Integer nodeCount;

	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date lastWarnTime;

	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date lastActiveTime;

	/**
	 *  记录的上报频率
	 */
	private Integer intervalSecond;

	/**
	 *  添加的模拟温度
	 */
	private Double addValue;

	private Integer sort;

	private Integer isShowLog;

	/**
	 *  报警音柱id
	 */
	private Integer ipVoiceId;

	/**
	 * 报警音柱编码
	 */
	private String ipVoiceCode;

	/**
	 *  语音文件路径 http 路径
	 */
	private String ipVoiceUrl;

	@TableField(exist = false)
	private String shopName;

	@TableField(exist = false)
	private List<DeviceNode> nodes;

	@TableField(exist = false)
	private Integer nodesCount;


	/**
	 *  是否有电流设备
	 */
	@TableField(exist = false)
	private Integer isHasPower;

}
